<?php /* Smarty version 2.6.26, created on 2018-07-05 16:54:30
         compiled from D:%5Cwww%5Cvweb/admin%5Ctemplates/article/category_edit.html */ ?>
<table width="100%" class="etable"> 
	<tr>
		<td width="100">分类</td>
		<td>
			<select name="pcid">
				<option value="0">一级分类</option>
			<?php unset($this->_sections['c']);
$this->_sections['c']['name'] = 'c';
$this->_sections['c']['loop'] = is_array($_loop=$this->_tpl_vars['cats_list']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['c']['show'] = true;
$this->_sections['c']['max'] = $this->_sections['c']['loop'];
$this->_sections['c']['step'] = 1;
$this->_sections['c']['start'] = $this->_sections['c']['step'] > 0 ? 0 : $this->_sections['c']['loop']-1;
if ($this->_sections['c']['show']) {
    $this->_sections['c']['total'] = $this->_sections['c']['loop'];
    if ($this->_sections['c']['total'] == 0)
        $this->_sections['c']['show'] = false;
} else
    $this->_sections['c']['total'] = 0;
if ($this->_sections['c']['show']):

            for ($this->_sections['c']['index'] = $this->_sections['c']['start'], $this->_sections['c']['iteration'] = 1;
                 $this->_sections['c']['iteration'] <= $this->_sections['c']['total'];
                 $this->_sections['c']['index'] += $this->_sections['c']['step'], $this->_sections['c']['iteration']++):
$this->_sections['c']['rownum'] = $this->_sections['c']['iteration'];
$this->_sections['c']['index_prev'] = $this->_sections['c']['index'] - $this->_sections['c']['step'];
$this->_sections['c']['index_next'] = $this->_sections['c']['index'] + $this->_sections['c']['step'];
$this->_sections['c']['first']      = ($this->_sections['c']['iteration'] == 1);
$this->_sections['c']['last']       = ($this->_sections['c']['iteration'] == $this->_sections['c']['total']);
?>				
				<option value="<?php echo $this->_tpl_vars['cats_list'][$this->_sections['c']['index']]['cid']; ?>
" <?php if ($this->_tpl_vars['cats_list'][$this->_sections['c']['index']]['cid'] == $this->_tpl_vars['row']['pcid']): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['cats_list'][$this->_sections['c']['index']]['name']; ?>
</option>
			<?php endfor; endif; ?>					
			</select>
		</td>
	</tr> 
	<tr>
		<td>名称</td>
		<td><input name="name" type="text" size="38" value="<?php echo $this->_tpl_vars['row']['name']; ?>
"> </td>
	</tr>
	<tr>
		<td>关键字</td>
		<td><input name="keywords" type="text" size="38" value="<?php echo $this->_tpl_vars['row']['keywords']; ?>
"></td>
	</tr>
	<tr>
		<td valign="top" style="padding-top:10px;">描述</td>
		<td><textarea name="describe" cols="38" rows="3"><?php echo $this->_tpl_vars['row']['describe']; ?>
</textarea></td>
	</tr> 
	<tr>
		<td>状态</td>
		<td>
			<label><input type="radio" value="1" name="status" <?php if ($this->_tpl_vars['row']['status'] == '' || $this->_tpl_vars['row']['status'] == '1'): ?>checked="checked"<?php endif; ?>/>开启</label>
			<label><input type="radio" value="0" name="status" <?php if ($this->_tpl_vars['row']['status'] == '0'): ?>checked="checked"<?php endif; ?>/>关闭</label>
		</td>
	</tr>
</table>   
<script type="text/javascript">
function ajax_submit(){
	var pcid = $('select[name="pcid"]').val();
	var name = $('input[name="name"]').val();
	var keywords = $('input[name="keywords"]').val();
	var describe = $('textarea[name="describe"]').val(); 
	var status = $('input[name="status"]:checked').val();
	$.post('?m=article&a=category_save', {<?php if ($this->_tpl_vars['row']['cid']): ?>cid:<?php echo $this->_tpl_vars['row']['cid']; ?>
,<?php endif; ?>pcid:pcid, name:name, keywords:keywords, describe:describe,status:status},function(result){ 
			data = jQuery.parseJSON(result); 
			if(data.error == '0'){ 
				parent.ajax_flush();
				parent.ajax_close(); 
			}else{
				alert(data.msg);
			} 
		});
}
</script>